package com.itrus.cryptorole.bc;

import com.itrus.cryptorole.CryptoException;
import com.itrus.cryptorole.NotSupportException;
import com.itrus.cryptorole.Sender;
import com.itrus.util.FileUtils;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.PrivateKey;
import java.security.Security;
import java.security.Signature;
import java.security.SignatureException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.Enumeration;
import java.util.Vector;
import org.bouncycastle.cms.CMSEnvelopedData;
import org.bouncycastle.cms.CMSEnvelopedDataGenerator;
import org.bouncycastle.cms.CMSException;
import org.bouncycastle.cms.CMSProcessableByteArray;
import org.bouncycastle.jce.PKCS7SignedData;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.util.encoders.Base64;

public class SenderBcImpl extends Sender
{
  public static final String AES128_CBC = "2.16.840.1.101.3.4.1.2";
  public static final String AES192_CBC = "2.16.840.1.101.3.4.1.22";
  public static final String AES256_CBC = "2.16.840.1.101.3.4.1.42";
  public static final String CAST5_CBC = "1.2.840.113533.7.66.10";
  public static final String DES_EDE3_CBC = "1.2.840.113549.3.7";
  public static final String IDEA_CBC = "1.3.6.1.4.1.188.7.1.1.2";
  private static String PROVIDER = "BC";
  public static final String RC2_CBC = "1.2.840.113549.3.2";

  static
  {
    if (Security.getProvider(PROVIDER) == null)
      Security.addProvider(new BouncyCastleProvider());
  }

  // ERROR //
  public static void encryptFileWithSymmtricKey(String paramString1, String paramString2, String paramString3)
    throws CryptoException
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_3
    //   2: aconst_null
    //   3: astore 4
    //   5: new 59	java/io/FileInputStream
    //   8: dup
    //   9: aload_1
    //   10: invokespecial 62	java/io/FileInputStream:<init>	(Ljava/lang/String;)V
    //   13: astore 5
    //   15: new 64	java/io/FileOutputStream
    //   18: dup
    //   19: aload_2
    //   20: invokespecial 65	java/io/FileOutputStream:<init>	(Ljava/lang/String;)V
    //   23: astore 6
    //   25: new 67	java/lang/String
    //   28: dup
    //   29: aload_0
    //   30: invokespecial 68	java/lang/String:<init>	(Ljava/lang/String;)V
    //   33: astore 7
    //   35: aload 7
    //   37: invokestatic 74	org/bouncycastle/util/encoders/Base64:decode	(Ljava/lang/String;)[B
    //   40: astore 15
    //   42: aconst_null
    //   43: checkcast 76	[B
    //   46: pop
    //   47: aconst_null
    //   48: checkcast 76	[B
    //   51: pop
    //   52: new 67	java/lang/String
    //   55: dup
    //   56: aload 15
    //   58: invokespecial 79	java/lang/String:<init>	([B)V
    //   61: astore 18
    //   63: aload 18
    //   65: ldc 81
    //   67: invokevirtual 85	java/lang/String:indexOf	(Ljava/lang/String;)I
    //   70: istore 19
    //   72: aload 18
    //   74: iconst_0
    //   75: iload 19
    //   77: invokevirtual 89	java/lang/String:substring	(II)Ljava/lang/String;
    //   80: astore 20
    //   82: aload 18
    //   84: iload 19
    //   86: iconst_1
    //   87: iadd
    //   88: invokevirtual 92	java/lang/String:substring	(I)Ljava/lang/String;
    //   91: astore 21
    //   93: aload 20
    //   95: invokevirtual 96	java/lang/String:getBytes	()[B
    //   98: astore 22
    //   100: aload 21
    //   102: invokevirtual 96	java/lang/String:getBytes	()[B
    //   105: astore 23
    //   107: new 67	java/lang/String
    //   110: dup
    //   111: aload 22
    //   113: invokespecial 79	java/lang/String:<init>	([B)V
    //   116: astore 24
    //   118: aload 24
    //   120: invokestatic 74	org/bouncycastle/util/encoders/Base64:decode	(Ljava/lang/String;)[B
    //   123: astore 25
    //   125: new 67	java/lang/String
    //   128: dup
    //   129: aload 23
    //   131: invokespecial 79	java/lang/String:<init>	([B)V
    //   134: astore 26
    //   136: aload 26
    //   138: invokestatic 74	org/bouncycastle/util/encoders/Base64:decode	(Ljava/lang/String;)[B
    //   141: astore 27
    //   143: new 98	javax/crypto/spec/DESedeKeySpec
    //   146: dup
    //   147: aload 25
    //   149: invokespecial 99	javax/crypto/spec/DESedeKeySpec:<init>	([B)V
    //   152: astore 28
    //   154: ldc 101
    //   156: invokestatic 107	javax/crypto/SecretKeyFactory:getInstance	(Ljava/lang/String;)Ljavax/crypto/SecretKeyFactory;
    //   159: aload 28
    //   161: invokevirtual 111	javax/crypto/SecretKeyFactory:generateSecret	(Ljava/security/spec/KeySpec;)Ljavax/crypto/SecretKey;
    //   164: astore 29
    //   166: new 113	javax/crypto/spec/IvParameterSpec
    //   169: dup
    //   170: aload 27
    //   172: iconst_0
    //   173: bipush 8
    //   175: invokespecial 116	javax/crypto/spec/IvParameterSpec:<init>	([BII)V
    //   178: astore 30
    //   180: ldc 118
    //   182: invokestatic 123	javax/crypto/Cipher:getInstance	(Ljava/lang/String;)Ljavax/crypto/Cipher;
    //   185: astore 31
    //   187: aload 31
    //   189: iconst_1
    //   190: aload 29
    //   192: aload 30
    //   194: aconst_null
    //   195: invokevirtual 127	javax/crypto/Cipher:init	(ILjava/security/Key;Ljava/security/spec/AlgorithmParameterSpec;Ljava/security/SecureRandom;)V
    //   198: sipush 10240
    //   201: newarray byte
    //   203: astore 32
    //   205: aconst_null
    //   206: checkcast 76	[B
    //   209: pop
    //   210: aload 5
    //   212: aload 32
    //   214: invokevirtual 133	java/io/InputStream:read	([B)I
    //   217: istore 34
    //   219: iload 34
    //   221: iconst_m1
    //   222: if_icmpne +34 -> 256
    //   225: aload 6
    //   227: aload 31
    //   229: invokevirtual 136	javax/crypto/Cipher:doFinal	()[B
    //   232: invokevirtual 141	java/io/OutputStream:write	([B)V
    //   235: aload 5
    //   237: ifnull +8 -> 245
    //   240: aload 5
    //   242: invokevirtual 144	java/io/InputStream:close	()V
    //   245: aload 6
    //   247: ifnull +8 -> 255
    //   250: aload 6
    //   252: invokevirtual 145	java/io/OutputStream:close	()V
    //   255: return
    //   256: aload 6
    //   258: aload 31
    //   260: aload 32
    //   262: iconst_0
    //   263: iload 34
    //   265: invokevirtual 149	javax/crypto/Cipher:update	([BII)[B
    //   268: invokevirtual 141	java/io/OutputStream:write	([B)V
    //   271: goto -61 -> 210
    //   274: astore 13
    //   276: aload 6
    //   278: astore 4
    //   280: aload 5
    //   282: astore_3
    //   283: new 53	com/itrus/cryptorole/CryptoException
    //   286: dup
    //   287: aload 13
    //   289: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   292: astore 14
    //   294: aload 14
    //   296: athrow
    //   297: astore 8
    //   299: aload_3
    //   300: ifnull +7 -> 307
    //   303: aload_3
    //   304: invokevirtual 144	java/io/InputStream:close	()V
    //   307: aload 4
    //   309: ifnull +8 -> 317
    //   312: aload 4
    //   314: invokevirtual 145	java/io/OutputStream:close	()V
    //   317: aload 8
    //   319: athrow
    //   320: astore 11
    //   322: new 53	com/itrus/cryptorole/CryptoException
    //   325: dup
    //   326: aload 11
    //   328: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   331: astore 12
    //   333: aload 12
    //   335: athrow
    //   336: astore 9
    //   338: new 53	com/itrus/cryptorole/CryptoException
    //   341: dup
    //   342: aload 9
    //   344: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   347: astore 10
    //   349: aload 10
    //   351: athrow
    //   352: astore 37
    //   354: new 53	com/itrus/cryptorole/CryptoException
    //   357: dup
    //   358: aload 37
    //   360: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   363: astore 38
    //   365: aload 38
    //   367: athrow
    //   368: astore 35
    //   370: new 53	com/itrus/cryptorole/CryptoException
    //   373: dup
    //   374: aload 35
    //   376: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   379: astore 36
    //   381: aload 36
    //   383: athrow
    //   384: astore 8
    //   386: aload 5
    //   388: astore_3
    //   389: aconst_null
    //   390: astore 4
    //   392: goto -93 -> 299
    //   395: astore 8
    //   397: aload 6
    //   399: astore 4
    //   401: aload 5
    //   403: astore_3
    //   404: goto -105 -> 299
    //   407: astore 13
    //   409: aconst_null
    //   410: astore_3
    //   411: aconst_null
    //   412: astore 4
    //   414: goto -131 -> 283
    //   417: astore 13
    //   419: aload 5
    //   421: astore_3
    //   422: aconst_null
    //   423: astore 4
    //   425: goto -142 -> 283
    //
    // Exception table:
    //   from	to	target	type
    //   25	210	274	java/lang/Exception
    //   210	219	274	java/lang/Exception
    //   225	235	274	java/lang/Exception
    //   256	271	274	java/lang/Exception
    //   5	15	297	finally
    //   283	297	297	finally
    //   303	307	320	java/io/IOException
    //   312	317	336	java/io/IOException
    //   240	245	352	java/io/IOException
    //   250	255	368	java/io/IOException
    //   15	25	384	finally
    //   25	210	395	finally
    //   210	219	395	finally
    //   225	235	395	finally
    //   256	271	395	finally
    //   5	15	407	java/lang/Exception
    //   15	25	417	java/lang/Exception
  }

  public byte[] doSign(byte[] paramArrayOfByte)
    throws NotSupportException, CryptoException
  {
    if ((this.keyOfSigner == null) || (this.certOfSigner == null))
      throw new CryptoException(this.notInitializeKeyMessage);
    try
    {
      Signature localSignature = Signature.getInstance(this.signAlgorithm);
      localSignature.initSign(this.keyOfSigner);
      localSignature.update(paramArrayOfByte);
      byte[] arrayOfByte = localSignature.sign();
      if (arrayOfByte != null)
        return arrayOfByte;
    }
    catch (NoSuchAlgorithmException localNoSuchAlgorithmException)
    {
      throw new CryptoException(localNoSuchAlgorithmException);
    }
    catch (InvalidKeyException localInvalidKeyException)
    {
      throw new CryptoException(localInvalidKeyException);
    }
    catch (SignatureException localSignatureException)
    {
      throw new CryptoException(localSignatureException);
    }
    throw new CryptoException("签名值生成失败");
  }

  public void encryptFile(String paramString1, String paramString2)
    throws CryptoException, IOException
  {
    FileUtils.saveBytesToFile(encryptMessage(FileUtils.readBytesFromFile(paramString1)), paramString2);
  }

  // ERROR //
  public void encryptFileEx(String paramString1, String paramString2)
    throws CryptoException
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_3
    //   2: aconst_null
    //   3: astore 4
    //   5: new 59	java/io/FileInputStream
    //   8: dup
    //   9: aload_1
    //   10: invokespecial 62	java/io/FileInputStream:<init>	(Ljava/lang/String;)V
    //   13: astore 5
    //   15: new 64	java/io/FileOutputStream
    //   18: dup
    //   19: aload_2
    //   20: invokespecial 65	java/io/FileOutputStream:<init>	(Ljava/lang/String;)V
    //   23: astore 6
    //   25: ldc 101
    //   27: invokestatic 225	javax/crypto/KeyGenerator:getInstance	(Ljava/lang/String;)Ljavax/crypto/KeyGenerator;
    //   30: invokevirtual 229	javax/crypto/KeyGenerator:generateKey	()Ljavax/crypto/SecretKey;
    //   33: astore 30
    //   35: ldc 101
    //   37: invokestatic 107	javax/crypto/SecretKeyFactory:getInstance	(Ljava/lang/String;)Ljavax/crypto/SecretKeyFactory;
    //   40: aload 30
    //   42: ldc 98
    //   44: invokevirtual 233	javax/crypto/SecretKeyFactory:getKeySpec	(Ljavax/crypto/SecretKey;Ljava/lang/Class;)Ljava/security/spec/KeySpec;
    //   47: checkcast 98	javax/crypto/spec/DESedeKeySpec
    //   50: invokevirtual 236	javax/crypto/spec/DESedeKeySpec:getKey	()[B
    //   53: astore 31
    //   55: bipush 32
    //   57: newarray byte
    //   59: astore 32
    //   61: iconst_0
    //   62: istore 33
    //   64: iload 33
    //   66: aload 32
    //   68: arraylength
    //   69: if_icmplt +271 -> 340
    //   72: new 67	java/lang/String
    //   75: dup
    //   76: aload 32
    //   78: invokestatic 239	org/bouncycastle/util/encoders/Base64:encode	([B)[B
    //   81: invokespecial 79	java/lang/String:<init>	([B)V
    //   84: astore 34
    //   86: aload 34
    //   88: invokevirtual 243	java/lang/String:trim	()Ljava/lang/String;
    //   91: astore 35
    //   93: new 113	javax/crypto/spec/IvParameterSpec
    //   96: dup
    //   97: bipush 8
    //   99: newarray byte
    //   101: invokespecial 244	javax/crypto/spec/IvParameterSpec:<init>	([B)V
    //   104: astore 36
    //   106: aload 36
    //   108: invokevirtual 247	javax/crypto/spec/IvParameterSpec:getIV	()[B
    //   111: astore 37
    //   113: bipush 16
    //   115: newarray byte
    //   117: astore 38
    //   119: iconst_0
    //   120: istore 39
    //   122: iload 39
    //   124: aload 38
    //   126: arraylength
    //   127: if_icmplt +289 -> 416
    //   130: new 67	java/lang/String
    //   133: dup
    //   134: aload 38
    //   136: invokestatic 239	org/bouncycastle/util/encoders/Base64:encode	([B)[B
    //   139: invokespecial 79	java/lang/String:<init>	([B)V
    //   142: astore 40
    //   144: aload 40
    //   146: invokevirtual 243	java/lang/String:trim	()Ljava/lang/String;
    //   149: astore 41
    //   151: new 249	java/lang/StringBuilder
    //   154: dup
    //   155: aload 35
    //   157: invokevirtual 243	java/lang/String:trim	()Ljava/lang/String;
    //   160: invokestatic 253	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   163: invokespecial 254	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   166: ldc 81
    //   168: invokevirtual 258	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   171: aload 41
    //   173: invokevirtual 243	java/lang/String:trim	()Ljava/lang/String;
    //   176: invokevirtual 258	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   179: invokevirtual 261	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   182: astore 42
    //   184: new 67	java/lang/String
    //   187: dup
    //   188: aload 42
    //   190: invokevirtual 96	java/lang/String:getBytes	()[B
    //   193: invokestatic 239	org/bouncycastle/util/encoders/Base64:encode	([B)[B
    //   196: invokespecial 79	java/lang/String:<init>	([B)V
    //   199: astore 43
    //   201: aload 6
    //   203: new 249	java/lang/StringBuilder
    //   206: dup
    //   207: new 67	java/lang/String
    //   210: dup
    //   211: aload_0
    //   212: aload 43
    //   214: ldc_w 263
    //   217: ldc_w 265
    //   220: invokevirtual 269	java/lang/String:replaceAll	(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    //   223: invokevirtual 96	java/lang/String:getBytes	()[B
    //   226: invokevirtual 203	com/itrus/cryptorole/bc/SenderBcImpl:encryptMessage	([B)[B
    //   229: invokestatic 239	org/bouncycastle/util/encoders/Base64:encode	([B)[B
    //   232: invokespecial 79	java/lang/String:<init>	([B)V
    //   235: ldc_w 263
    //   238: ldc_w 265
    //   241: invokevirtual 269	java/lang/String:replaceAll	(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    //   244: invokestatic 253	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   247: invokespecial 254	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   250: ldc 81
    //   252: invokevirtual 258	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   255: invokevirtual 261	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   258: invokevirtual 96	java/lang/String:getBytes	()[B
    //   261: invokevirtual 141	java/io/OutputStream:write	([B)V
    //   264: ldc 118
    //   266: invokestatic 123	javax/crypto/Cipher:getInstance	(Ljava/lang/String;)Ljavax/crypto/Cipher;
    //   269: astore 44
    //   271: aload 44
    //   273: iconst_1
    //   274: aload 30
    //   276: aload 36
    //   278: aconst_null
    //   279: invokevirtual 127	javax/crypto/Cipher:init	(ILjava/security/Key;Ljava/security/spec/AlgorithmParameterSpec;Ljava/security/SecureRandom;)V
    //   282: sipush 10240
    //   285: newarray byte
    //   287: astore 45
    //   289: aconst_null
    //   290: checkcast 76	[B
    //   293: pop
    //   294: aload 5
    //   296: aload 45
    //   298: invokevirtual 133	java/io/InputStream:read	([B)I
    //   301: istore 47
    //   303: iload 47
    //   305: iconst_m1
    //   306: if_icmpne +163 -> 469
    //   309: aload 6
    //   311: aload 44
    //   313: invokevirtual 136	javax/crypto/Cipher:doFinal	()[B
    //   316: invokevirtual 141	java/io/OutputStream:write	([B)V
    //   319: aload 5
    //   321: ifnull +8 -> 329
    //   324: aload 5
    //   326: invokevirtual 144	java/io/InputStream:close	()V
    //   329: aload 6
    //   331: ifnull +8 -> 339
    //   334: aload 6
    //   336: invokevirtual 145	java/io/OutputStream:close	()V
    //   339: return
    //   340: iload 33
    //   342: aload 31
    //   344: arraylength
    //   345: if_icmpge +16 -> 361
    //   348: aload 32
    //   350: iload 33
    //   352: aload 31
    //   354: iload 33
    //   356: baload
    //   357: bastore
    //   358: goto +524 -> 882
    //   361: aload 32
    //   363: iload 33
    //   365: iconst_0
    //   366: bastore
    //   367: goto +515 -> 882
    //   370: astore 28
    //   372: aload 6
    //   374: astore 4
    //   376: aload 5
    //   378: astore_3
    //   379: new 53	com/itrus/cryptorole/CryptoException
    //   382: dup
    //   383: aload 28
    //   385: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   388: astore 29
    //   390: aload 29
    //   392: athrow
    //   393: astore 9
    //   395: aload_3
    //   396: ifnull +7 -> 403
    //   399: aload_3
    //   400: invokevirtual 144	java/io/InputStream:close	()V
    //   403: aload 4
    //   405: ifnull +8 -> 413
    //   408: aload 4
    //   410: invokevirtual 145	java/io/OutputStream:close	()V
    //   413: aload 9
    //   415: athrow
    //   416: iload 39
    //   418: aload 37
    //   420: arraylength
    //   421: if_icmpge +16 -> 437
    //   424: aload 38
    //   426: iload 39
    //   428: aload 37
    //   430: iload 39
    //   432: baload
    //   433: bastore
    //   434: goto +454 -> 888
    //   437: aload 38
    //   439: iload 39
    //   441: iconst_0
    //   442: bastore
    //   443: goto +445 -> 888
    //   446: astore 26
    //   448: aload 6
    //   450: astore 4
    //   452: aload 5
    //   454: astore_3
    //   455: new 53	com/itrus/cryptorole/CryptoException
    //   458: dup
    //   459: aload 26
    //   461: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   464: astore 27
    //   466: aload 27
    //   468: athrow
    //   469: aload 6
    //   471: aload 44
    //   473: aload 45
    //   475: iconst_0
    //   476: iload 47
    //   478: invokevirtual 149	javax/crypto/Cipher:update	([BII)[B
    //   481: invokevirtual 141	java/io/OutputStream:write	([B)V
    //   484: goto -190 -> 294
    //   487: astore 24
    //   489: aload 6
    //   491: astore 4
    //   493: aload 5
    //   495: astore_3
    //   496: new 53	com/itrus/cryptorole/CryptoException
    //   499: dup
    //   500: aload 24
    //   502: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   505: astore 25
    //   507: aload 25
    //   509: athrow
    //   510: new 53	com/itrus/cryptorole/CryptoException
    //   513: dup
    //   514: aload 7
    //   516: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   519: astore 8
    //   521: aload 8
    //   523: athrow
    //   524: new 53	com/itrus/cryptorole/CryptoException
    //   527: dup
    //   528: aload 14
    //   530: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   533: astore 15
    //   535: aload 15
    //   537: athrow
    //   538: new 53	com/itrus/cryptorole/CryptoException
    //   541: dup
    //   542: aload 16
    //   544: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   547: astore 17
    //   549: aload 17
    //   551: athrow
    //   552: new 53	com/itrus/cryptorole/CryptoException
    //   555: dup
    //   556: aload 18
    //   558: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   561: astore 19
    //   563: aload 19
    //   565: athrow
    //   566: new 53	com/itrus/cryptorole/CryptoException
    //   569: dup
    //   570: aload 20
    //   572: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   575: astore 21
    //   577: aload 21
    //   579: athrow
    //   580: new 53	com/itrus/cryptorole/CryptoException
    //   583: dup
    //   584: aload 22
    //   586: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   589: astore 23
    //   591: aload 23
    //   593: athrow
    //   594: astore 12
    //   596: new 53	com/itrus/cryptorole/CryptoException
    //   599: dup
    //   600: aload 12
    //   602: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   605: astore 13
    //   607: aload 13
    //   609: athrow
    //   610: astore 10
    //   612: new 53	com/itrus/cryptorole/CryptoException
    //   615: dup
    //   616: aload 10
    //   618: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   621: astore 11
    //   623: aload 11
    //   625: athrow
    //   626: astore 50
    //   628: new 53	com/itrus/cryptorole/CryptoException
    //   631: dup
    //   632: aload 50
    //   634: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   637: astore 51
    //   639: aload 51
    //   641: athrow
    //   642: astore 48
    //   644: new 53	com/itrus/cryptorole/CryptoException
    //   647: dup
    //   648: aload 48
    //   650: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   653: astore 49
    //   655: aload 49
    //   657: athrow
    //   658: astore 9
    //   660: aload 5
    //   662: astore_3
    //   663: aconst_null
    //   664: astore 4
    //   666: goto -271 -> 395
    //   669: astore 9
    //   671: aload 6
    //   673: astore 4
    //   675: aload 5
    //   677: astore_3
    //   678: goto -283 -> 395
    //   681: astore 22
    //   683: aload 5
    //   685: astore_3
    //   686: aconst_null
    //   687: astore 4
    //   689: goto -109 -> 580
    //   692: astore 22
    //   694: aload 6
    //   696: astore 4
    //   698: aload 5
    //   700: astore_3
    //   701: goto -121 -> 580
    //   704: astore 20
    //   706: aload 5
    //   708: astore_3
    //   709: aconst_null
    //   710: astore 4
    //   712: goto -146 -> 566
    //   715: astore 20
    //   717: aload 6
    //   719: astore 4
    //   721: aload 5
    //   723: astore_3
    //   724: goto -158 -> 566
    //   727: astore 18
    //   729: aload 5
    //   731: astore_3
    //   732: aconst_null
    //   733: astore 4
    //   735: goto -183 -> 552
    //   738: astore 18
    //   740: aload 6
    //   742: astore 4
    //   744: aload 5
    //   746: astore_3
    //   747: goto -195 -> 552
    //   750: astore 16
    //   752: aload 5
    //   754: astore_3
    //   755: aconst_null
    //   756: astore 4
    //   758: goto -220 -> 538
    //   761: astore 16
    //   763: aload 6
    //   765: astore 4
    //   767: aload 5
    //   769: astore_3
    //   770: goto -232 -> 538
    //   773: astore 14
    //   775: aload 5
    //   777: astore_3
    //   778: aconst_null
    //   779: astore 4
    //   781: goto -257 -> 524
    //   784: astore 14
    //   786: aload 6
    //   788: astore 4
    //   790: aload 5
    //   792: astore_3
    //   793: goto -269 -> 524
    //   796: astore 7
    //   798: aload 5
    //   800: astore_3
    //   801: aconst_null
    //   802: astore 4
    //   804: goto -294 -> 510
    //   807: astore 7
    //   809: aload 6
    //   811: astore 4
    //   813: aload 5
    //   815: astore_3
    //   816: goto -306 -> 510
    //   819: astore 24
    //   821: aconst_null
    //   822: astore_3
    //   823: aconst_null
    //   824: astore 4
    //   826: goto -330 -> 496
    //   829: astore 24
    //   831: aload 5
    //   833: astore_3
    //   834: aconst_null
    //   835: astore 4
    //   837: goto -341 -> 496
    //   840: astore 26
    //   842: aconst_null
    //   843: astore_3
    //   844: aconst_null
    //   845: astore 4
    //   847: goto -392 -> 455
    //   850: astore 26
    //   852: aload 5
    //   854: astore_3
    //   855: aconst_null
    //   856: astore 4
    //   858: goto -403 -> 455
    //   861: astore 28
    //   863: aconst_null
    //   864: astore_3
    //   865: aconst_null
    //   866: astore 4
    //   868: goto -489 -> 379
    //   871: astore 28
    //   873: aload 5
    //   875: astore_3
    //   876: aconst_null
    //   877: astore 4
    //   879: goto -500 -> 379
    //   882: iinc 33 1
    //   885: goto -821 -> 64
    //   888: iinc 39 1
    //   891: goto -769 -> 122
    //   894: astore 7
    //   896: aconst_null
    //   897: astore_3
    //   898: aconst_null
    //   899: astore 4
    //   901: goto -391 -> 510
    //   904: astore 14
    //   906: aconst_null
    //   907: astore_3
    //   908: aconst_null
    //   909: astore 4
    //   911: goto -387 -> 524
    //   914: astore 16
    //   916: aconst_null
    //   917: astore_3
    //   918: aconst_null
    //   919: astore 4
    //   921: goto -383 -> 538
    //   924: astore 18
    //   926: aconst_null
    //   927: astore_3
    //   928: aconst_null
    //   929: astore 4
    //   931: goto -379 -> 552
    //   934: astore 20
    //   936: aconst_null
    //   937: astore_3
    //   938: aconst_null
    //   939: astore 4
    //   941: goto -375 -> 566
    //   944: astore 22
    //   946: aconst_null
    //   947: astore_3
    //   948: aconst_null
    //   949: astore 4
    //   951: goto -371 -> 580
    //
    // Exception table:
    //   from	to	target	type
    //   25	61	370	java/io/FileNotFoundException
    //   64	119	370	java/io/FileNotFoundException
    //   122	294	370	java/io/FileNotFoundException
    //   294	303	370	java/io/FileNotFoundException
    //   309	319	370	java/io/FileNotFoundException
    //   340	358	370	java/io/FileNotFoundException
    //   361	367	370	java/io/FileNotFoundException
    //   416	434	370	java/io/FileNotFoundException
    //   437	443	370	java/io/FileNotFoundException
    //   469	484	370	java/io/FileNotFoundException
    //   5	15	393	finally
    //   379	393	393	finally
    //   455	469	393	finally
    //   496	510	393	finally
    //   510	524	393	finally
    //   524	538	393	finally
    //   538	552	393	finally
    //   552	566	393	finally
    //   566	580	393	finally
    //   580	594	393	finally
    //   25	61	446	java/security/NoSuchAlgorithmException
    //   64	119	446	java/security/NoSuchAlgorithmException
    //   122	294	446	java/security/NoSuchAlgorithmException
    //   294	303	446	java/security/NoSuchAlgorithmException
    //   309	319	446	java/security/NoSuchAlgorithmException
    //   340	358	446	java/security/NoSuchAlgorithmException
    //   361	367	446	java/security/NoSuchAlgorithmException
    //   416	434	446	java/security/NoSuchAlgorithmException
    //   437	443	446	java/security/NoSuchAlgorithmException
    //   469	484	446	java/security/NoSuchAlgorithmException
    //   25	61	487	java/security/spec/InvalidKeySpecException
    //   64	119	487	java/security/spec/InvalidKeySpecException
    //   122	294	487	java/security/spec/InvalidKeySpecException
    //   294	303	487	java/security/spec/InvalidKeySpecException
    //   309	319	487	java/security/spec/InvalidKeySpecException
    //   340	358	487	java/security/spec/InvalidKeySpecException
    //   361	367	487	java/security/spec/InvalidKeySpecException
    //   416	434	487	java/security/spec/InvalidKeySpecException
    //   437	443	487	java/security/spec/InvalidKeySpecException
    //   469	484	487	java/security/spec/InvalidKeySpecException
    //   399	403	594	java/io/IOException
    //   408	413	610	java/io/IOException
    //   324	329	626	java/io/IOException
    //   334	339	642	java/io/IOException
    //   15	25	658	finally
    //   25	61	669	finally
    //   64	119	669	finally
    //   122	294	669	finally
    //   294	303	669	finally
    //   309	319	669	finally
    //   340	358	669	finally
    //   361	367	669	finally
    //   416	434	669	finally
    //   437	443	669	finally
    //   469	484	669	finally
    //   15	25	681	javax/crypto/BadPaddingException
    //   25	61	692	javax/crypto/BadPaddingException
    //   64	119	692	javax/crypto/BadPaddingException
    //   122	294	692	javax/crypto/BadPaddingException
    //   294	303	692	javax/crypto/BadPaddingException
    //   309	319	692	javax/crypto/BadPaddingException
    //   340	358	692	javax/crypto/BadPaddingException
    //   361	367	692	javax/crypto/BadPaddingException
    //   416	434	692	javax/crypto/BadPaddingException
    //   437	443	692	javax/crypto/BadPaddingException
    //   469	484	692	javax/crypto/BadPaddingException
    //   15	25	704	javax/crypto/IllegalBlockSizeException
    //   25	61	715	javax/crypto/IllegalBlockSizeException
    //   64	119	715	javax/crypto/IllegalBlockSizeException
    //   122	294	715	javax/crypto/IllegalBlockSizeException
    //   294	303	715	javax/crypto/IllegalBlockSizeException
    //   309	319	715	javax/crypto/IllegalBlockSizeException
    //   340	358	715	javax/crypto/IllegalBlockSizeException
    //   361	367	715	javax/crypto/IllegalBlockSizeException
    //   416	434	715	javax/crypto/IllegalBlockSizeException
    //   437	443	715	javax/crypto/IllegalBlockSizeException
    //   469	484	715	javax/crypto/IllegalBlockSizeException
    //   15	25	727	java/io/IOException
    //   25	61	738	java/io/IOException
    //   64	119	738	java/io/IOException
    //   122	294	738	java/io/IOException
    //   294	303	738	java/io/IOException
    //   309	319	738	java/io/IOException
    //   340	358	738	java/io/IOException
    //   361	367	738	java/io/IOException
    //   416	434	738	java/io/IOException
    //   437	443	738	java/io/IOException
    //   469	484	738	java/io/IOException
    //   15	25	750	java/security/InvalidAlgorithmParameterException
    //   25	61	761	java/security/InvalidAlgorithmParameterException
    //   64	119	761	java/security/InvalidAlgorithmParameterException
    //   122	294	761	java/security/InvalidAlgorithmParameterException
    //   294	303	761	java/security/InvalidAlgorithmParameterException
    //   309	319	761	java/security/InvalidAlgorithmParameterException
    //   340	358	761	java/security/InvalidAlgorithmParameterException
    //   361	367	761	java/security/InvalidAlgorithmParameterException
    //   416	434	761	java/security/InvalidAlgorithmParameterException
    //   437	443	761	java/security/InvalidAlgorithmParameterException
    //   469	484	761	java/security/InvalidAlgorithmParameterException
    //   15	25	773	java/security/InvalidKeyException
    //   25	61	784	java/security/InvalidKeyException
    //   64	119	784	java/security/InvalidKeyException
    //   122	294	784	java/security/InvalidKeyException
    //   294	303	784	java/security/InvalidKeyException
    //   309	319	784	java/security/InvalidKeyException
    //   340	358	784	java/security/InvalidKeyException
    //   361	367	784	java/security/InvalidKeyException
    //   416	434	784	java/security/InvalidKeyException
    //   437	443	784	java/security/InvalidKeyException
    //   469	484	784	java/security/InvalidKeyException
    //   15	25	796	javax/crypto/NoSuchPaddingException
    //   25	61	807	javax/crypto/NoSuchPaddingException
    //   64	119	807	javax/crypto/NoSuchPaddingException
    //   122	294	807	javax/crypto/NoSuchPaddingException
    //   294	303	807	javax/crypto/NoSuchPaddingException
    //   309	319	807	javax/crypto/NoSuchPaddingException
    //   340	358	807	javax/crypto/NoSuchPaddingException
    //   361	367	807	javax/crypto/NoSuchPaddingException
    //   416	434	807	javax/crypto/NoSuchPaddingException
    //   437	443	807	javax/crypto/NoSuchPaddingException
    //   469	484	807	javax/crypto/NoSuchPaddingException
    //   5	15	819	java/security/spec/InvalidKeySpecException
    //   15	25	829	java/security/spec/InvalidKeySpecException
    //   5	15	840	java/security/NoSuchAlgorithmException
    //   15	25	850	java/security/NoSuchAlgorithmException
    //   5	15	861	java/io/FileNotFoundException
    //   15	25	871	java/io/FileNotFoundException
    //   5	15	894	javax/crypto/NoSuchPaddingException
    //   5	15	904	java/security/InvalidKeyException
    //   5	15	914	java/security/InvalidAlgorithmParameterException
    //   5	15	924	java/io/IOException
    //   5	15	934	javax/crypto/IllegalBlockSizeException
    //   5	15	944	javax/crypto/BadPaddingException
  }

  public byte[] encryptMessage(byte[] paramArrayOfByte)
    throws CryptoException
  {
    CMSEnvelopedDataGenerator localCMSEnvelopedDataGenerator = new CMSEnvelopedDataGenerator();
    if (this.recipientCerts.size() == 0)
      throw new CryptoException(this.notAddEncryptCertMessage);
    int i = 0;
    while (true)
    {
      CMSProcessableByteArray localCMSProcessableByteArray;
      if (i >= this.recipientCerts.size())
        localCMSProcessableByteArray = new CMSProcessableByteArray(paramArrayOfByte);
      try
      {
        byte[] arrayOfByte = localCMSEnvelopedDataGenerator.generate(localCMSProcessableByteArray, this.encryptAlgorithm, PROVIDER).getEncoded();
        return arrayOfByte;
        localCMSEnvelopedDataGenerator.addKeyTransRecipient((X509Certificate)this.recipientCerts.elementAt(i));
        i++;
      }
      catch (NoSuchAlgorithmException localNoSuchAlgorithmException)
      {
        throw new CryptoException(localNoSuchAlgorithmException);
      }
      catch (NoSuchProviderException localNoSuchProviderException)
      {
        throw new CryptoException(localNoSuchProviderException);
      }
      catch (CMSException localCMSException)
      {
        throw new CryptoException(localCMSException);
      }
      catch (IOException localIOException)
      {
        throw new CryptoException(localIOException);
      }
    }
  }

  public void initCertWithKey(String paramString1, String paramString2)
    throws NotSupportException, CryptoException
  {
    initCertWithKey(paramString1, paramString2.toCharArray());
  }

  public void initCertWithKey(String paramString, char[] paramArrayOfChar)
    throws NotSupportException, CryptoException
  {
    try
    {
      FileInputStream localFileInputStream = new FileInputStream(paramString);
      KeyStore localKeyStore = KeyStore.getInstance("PKCS12");
      localKeyStore.load(localFileInputStream, paramArrayOfChar);
      localFileInputStream.close();
      Enumeration localEnumeration = localKeyStore.aliases();
      while (true)
      {
        if (!localEnumeration.hasMoreElements())
          return;
        String str = (String)localEnumeration.nextElement();
        if (localKeyStore.isKeyEntry(str))
        {
          this.keyOfSigner = ((PrivateKey)localKeyStore.getKey(str, paramArrayOfChar));
          this.certOfSigner = ((X509Certificate)localKeyStore.getCertificate(str));
        }
      }
    }
    catch (FileNotFoundException localFileNotFoundException)
    {
      throw new CryptoException(localFileNotFoundException);
    }
    catch (KeyStoreException localKeyStoreException)
    {
      throw new CryptoException(localKeyStoreException);
    }
    catch (NoSuchAlgorithmException localNoSuchAlgorithmException)
    {
      throw new CryptoException(localNoSuchAlgorithmException);
    }
    catch (CertificateException localCertificateException)
    {
      throw new CryptoException(localCertificateException);
    }
    catch (IOException localIOException)
    {
      throw new CryptoException(localIOException);
    }
    catch (UnrecoverableKeyException localUnrecoverableKeyException)
    {
      throw new CryptoException(localUnrecoverableKeyException);
    }
  }

  public void initCertWithKey(String paramString1, char[] paramArrayOfChar1, String paramString2, char[] paramArrayOfChar2)
    throws NotSupportException, CryptoException
  {
    try
    {
      FileInputStream localFileInputStream = new FileInputStream(paramString1);
      KeyStore localKeyStore = KeyStore.getInstance("JKS");
      localKeyStore.load(localFileInputStream, paramArrayOfChar1);
      localFileInputStream.close();
      this.keyOfSigner = ((PrivateKey)localKeyStore.getKey(paramString2, paramArrayOfChar2));
      this.certOfSigner = ((X509Certificate)localKeyStore.getCertificate(paramString2));
      return;
    }
    catch (FileNotFoundException localFileNotFoundException)
    {
      throw new CryptoException(localFileNotFoundException);
    }
    catch (KeyStoreException localKeyStoreException)
    {
      throw new CryptoException(localKeyStoreException);
    }
    catch (NoSuchAlgorithmException localNoSuchAlgorithmException)
    {
      throw new CryptoException(localNoSuchAlgorithmException);
    }
    catch (CertificateException localCertificateException)
    {
      throw new CryptoException(localCertificateException);
    }
    catch (IOException localIOException)
    {
      throw new CryptoException(localIOException);
    }
    catch (UnrecoverableKeyException localUnrecoverableKeyException)
    {
      throw new CryptoException(localUnrecoverableKeyException);
    }
  }

  // ERROR //
  public byte[] signAndEnvelopMessage(byte[] paramArrayOfByte)
    throws CryptoException
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 166	com/itrus/cryptorole/bc/SenderBcImpl:keyOfSigner	Ljava/security/PrivateKey;
    //   4: ifnull +10 -> 14
    //   7: aload_0
    //   8: getfield 170	com/itrus/cryptorole/bc/SenderBcImpl:certOfSigner	Ljava/security/cert/X509Certificate;
    //   11: ifnonnull +15 -> 26
    //   14: new 53	com/itrus/cryptorole/CryptoException
    //   17: dup
    //   18: aload_0
    //   19: getfield 173	com/itrus/cryptorole/bc/SenderBcImpl:notInitializeKeyMessage	Ljava/lang/String;
    //   22: invokespecial 174	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/String;)V
    //   25: athrow
    //   26: aload_0
    //   27: getfield 280	com/itrus/cryptorole/bc/SenderBcImpl:recipientCerts	Ljava/util/Vector;
    //   30: invokevirtual 286	java/util/Vector:size	()I
    //   33: ifne +15 -> 48
    //   36: new 53	com/itrus/cryptorole/CryptoException
    //   39: dup
    //   40: aload_0
    //   41: getfield 289	com/itrus/cryptorole/bc/SenderBcImpl:notAddEncryptCertMessage	Ljava/lang/String;
    //   44: invokespecial 174	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/String;)V
    //   47: athrow
    //   48: new 377	org/bouncycastle/cms/CMSSignedDataGenerator
    //   51: dup
    //   52: invokespecial 378	org/bouncycastle/cms/CMSSignedDataGenerator:<init>	()V
    //   55: astore_2
    //   56: new 275	org/bouncycastle/cms/CMSEnvelopedDataGenerator
    //   59: dup
    //   60: invokespecial 276	org/bouncycastle/cms/CMSEnvelopedDataGenerator:<init>	()V
    //   63: astore_3
    //   64: aload_2
    //   65: aload_0
    //   66: getfield 166	com/itrus/cryptorole/bc/SenderBcImpl:keyOfSigner	Ljava/security/PrivateKey;
    //   69: aload_0
    //   70: getfield 170	com/itrus/cryptorole/bc/SenderBcImpl:certOfSigner	Ljava/security/cert/X509Certificate;
    //   73: getstatic 383	org/bouncycastle/cms/CMSSignedGenerator:DIGEST_SHA1	Ljava/lang/String;
    //   76: invokevirtual 387	org/bouncycastle/cms/CMSSignedDataGenerator:addSigner	(Ljava/security/PrivateKey;Ljava/security/cert/X509Certificate;Ljava/lang/String;)V
    //   79: iconst_1
    //   80: anewarray 310	java/security/cert/X509Certificate
    //   83: astore 4
    //   85: aload 4
    //   87: iconst_0
    //   88: aload_0
    //   89: getfield 170	com/itrus/cryptorole/bc/SenderBcImpl:certOfSigner	Ljava/security/cert/X509Certificate;
    //   92: aastore
    //   93: aload_2
    //   94: ldc_w 389
    //   97: new 391	java/security/cert/CollectionCertStoreParameters
    //   100: dup
    //   101: aload 4
    //   103: invokestatic 397	java/util/Arrays:asList	([Ljava/lang/Object;)Ljava/util/List;
    //   106: invokespecial 400	java/security/cert/CollectionCertStoreParameters:<init>	(Ljava/util/Collection;)V
    //   109: getstatic 33	com/itrus/cryptorole/bc/SenderBcImpl:PROVIDER	Ljava/lang/String;
    //   112: invokestatic 405	java/security/cert/CertStore:getInstance	(Ljava/lang/String;Ljava/security/cert/CertStoreParameters;Ljava/lang/String;)Ljava/security/cert/CertStore;
    //   115: invokevirtual 409	org/bouncycastle/cms/CMSSignedDataGenerator:addCertificatesAndCRLs	(Ljava/security/cert/CertStore;)V
    //   118: new 291	org/bouncycastle/cms/CMSProcessableByteArray
    //   121: dup
    //   122: aload_1
    //   123: invokespecial 292	org/bouncycastle/cms/CMSProcessableByteArray:<init>	([B)V
    //   126: astore 10
    //   128: aload_2
    //   129: aload 10
    //   131: getstatic 33	com/itrus/cryptorole/bc/SenderBcImpl:PROVIDER	Ljava/lang/String;
    //   134: invokevirtual 412	org/bouncycastle/cms/CMSSignedDataGenerator:generate	(Lorg/bouncycastle/cms/CMSProcessable;Ljava/lang/String;)Lorg/bouncycastle/cms/CMSSignedData;
    //   137: astore 14
    //   139: iconst_0
    //   140: istore 15
    //   142: aload_0
    //   143: getfield 280	com/itrus/cryptorole/bc/SenderBcImpl:recipientCerts	Ljava/util/Vector;
    //   146: invokevirtual 286	java/util/Vector:size	()I
    //   149: istore 16
    //   151: iload 15
    //   153: iload 16
    //   155: if_icmplt +237 -> 392
    //   158: aload_3
    //   159: aload 10
    //   161: aload_0
    //   162: getfield 295	com/itrus/cryptorole/bc/SenderBcImpl:encryptAlgorithm	Ljava/lang/String;
    //   165: getstatic 33	com/itrus/cryptorole/bc/SenderBcImpl:PROVIDER	Ljava/lang/String;
    //   168: invokevirtual 299	org/bouncycastle/cms/CMSEnvelopedDataGenerator:generate	(Lorg/bouncycastle/cms/CMSProcessable;Ljava/lang/String;Ljava/lang/String;)Lorg/bouncycastle/cms/CMSEnvelopedData;
    //   171: astore 20
    //   173: aload 14
    //   175: invokevirtual 418	org/bouncycastle/cms/CMSSignedData:getContentInfo	()Lorg/bouncycastle/asn1/cms/ContentInfo;
    //   178: invokevirtual 424	org/bouncycastle/asn1/cms/ContentInfo:getContent	()Lorg/bouncycastle/asn1/DEREncodable;
    //   181: invokestatic 429	org/bouncycastle/asn1/cms/SignedData:getInstance	(Ljava/lang/Object;)Lorg/bouncycastle/asn1/cms/SignedData;
    //   184: astore 21
    //   186: aload 21
    //   188: invokevirtual 433	org/bouncycastle/asn1/cms/SignedData:getSignerInfos	()Lorg/bouncycastle/asn1/ASN1Set;
    //   191: astore 22
    //   193: aload 20
    //   195: invokevirtual 434	org/bouncycastle/cms/CMSEnvelopedData:getContentInfo	()Lorg/bouncycastle/asn1/cms/ContentInfo;
    //   198: invokevirtual 424	org/bouncycastle/asn1/cms/ContentInfo:getContent	()Lorg/bouncycastle/asn1/DEREncodable;
    //   201: invokestatic 439	org/bouncycastle/asn1/cms/EnvelopedData:getInstance	(Ljava/lang/Object;)Lorg/bouncycastle/asn1/cms/EnvelopedData;
    //   204: astore 23
    //   206: aload 23
    //   208: invokevirtual 442	org/bouncycastle/asn1/cms/EnvelopedData:getRecipientInfos	()Lorg/bouncycastle/asn1/ASN1Set;
    //   211: astore 24
    //   213: aload 23
    //   215: invokevirtual 446	org/bouncycastle/asn1/cms/EnvelopedData:getEncryptedContentInfo	()Lorg/bouncycastle/asn1/cms/EncryptedContentInfo;
    //   218: astore 25
    //   220: aload 21
    //   222: invokevirtual 449	org/bouncycastle/asn1/cms/SignedData:getDigestAlgorithms	()Lorg/bouncycastle/asn1/ASN1Set;
    //   225: astore 26
    //   227: new 451	org/bouncycastle/asn1/ASN1EncodableVector
    //   230: dup
    //   231: invokespecial 452	org/bouncycastle/asn1/ASN1EncodableVector:<init>	()V
    //   234: astore 27
    //   236: aload 27
    //   238: aload_0
    //   239: getfield 170	com/itrus/cryptorole/bc/SenderBcImpl:certOfSigner	Ljava/security/cert/X509Certificate;
    //   242: invokevirtual 453	java/security/cert/X509Certificate:getEncoded	()[B
    //   245: invokestatic 459	org/bouncycastle/asn1/ASN1Object:fromByteArray	([B)Lorg/bouncycastle/asn1/ASN1Object;
    //   248: invokestatic 464	org/bouncycastle/asn1/x509/X509CertificateStructure:getInstance	(Ljava/lang/Object;)Lorg/bouncycastle/asn1/x509/X509CertificateStructure;
    //   251: invokevirtual 468	org/bouncycastle/asn1/ASN1EncodableVector:add	(Lorg/bouncycastle/asn1/DEREncodable;)V
    //   254: new 470	com/itrus/asn1/cms/SignedAndEnvelopedData
    //   257: dup
    //   258: aload 24
    //   260: aload 26
    //   262: aload 25
    //   264: new 472	org/bouncycastle/asn1/DERSet
    //   267: dup
    //   268: aload 27
    //   270: invokespecial 475	org/bouncycastle/asn1/DERSet:<init>	(Lorg/bouncycastle/asn1/DEREncodableVector;)V
    //   273: aconst_null
    //   274: aload 22
    //   276: invokespecial 478	com/itrus/asn1/cms/SignedAndEnvelopedData:<init>	(Lorg/bouncycastle/asn1/ASN1Set;Lorg/bouncycastle/asn1/ASN1Set;Lorg/bouncycastle/asn1/cms/EncryptedContentInfo;Lorg/bouncycastle/asn1/ASN1Set;Lorg/bouncycastle/asn1/ASN1Set;Lorg/bouncycastle/asn1/ASN1Set;)V
    //   279: astore 30
    //   281: aconst_null
    //   282: checkcast 76	[B
    //   285: pop
    //   286: aload 30
    //   288: invokevirtual 479	com/itrus/asn1/cms/SignedAndEnvelopedData:getEncoded	()[B
    //   291: astore 33
    //   293: aload 33
    //   295: areturn
    //   296: astore 9
    //   298: new 53	com/itrus/cryptorole/CryptoException
    //   301: dup
    //   302: aload 9
    //   304: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   307: athrow
    //   308: astore 8
    //   310: new 53	com/itrus/cryptorole/CryptoException
    //   313: dup
    //   314: aload 8
    //   316: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   319: athrow
    //   320: astore 7
    //   322: new 53	com/itrus/cryptorole/CryptoException
    //   325: dup
    //   326: aload 7
    //   328: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   331: athrow
    //   332: astore 6
    //   334: new 53	com/itrus/cryptorole/CryptoException
    //   337: dup
    //   338: aload 6
    //   340: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   343: athrow
    //   344: astore 5
    //   346: new 53	com/itrus/cryptorole/CryptoException
    //   349: dup
    //   350: aload 5
    //   352: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   355: athrow
    //   356: astore 13
    //   358: new 53	com/itrus/cryptorole/CryptoException
    //   361: dup
    //   362: aload 13
    //   364: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   367: athrow
    //   368: astore 12
    //   370: new 53	com/itrus/cryptorole/CryptoException
    //   373: dup
    //   374: aload 12
    //   376: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   379: athrow
    //   380: astore 11
    //   382: new 53	com/itrus/cryptorole/CryptoException
    //   385: dup
    //   386: aload 11
    //   388: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   391: athrow
    //   392: aload_3
    //   393: aload_0
    //   394: getfield 280	com/itrus/cryptorole/bc/SenderBcImpl:recipientCerts	Ljava/util/Vector;
    //   397: iload 15
    //   399: invokevirtual 308	java/util/Vector:elementAt	(I)Ljava/lang/Object;
    //   402: checkcast 310	java/security/cert/X509Certificate
    //   405: invokevirtual 314	org/bouncycastle/cms/CMSEnvelopedDataGenerator:addKeyTransRecipient	(Ljava/security/cert/X509Certificate;)V
    //   408: iinc 15 1
    //   411: goto -269 -> 142
    //   414: astore 19
    //   416: new 53	com/itrus/cryptorole/CryptoException
    //   419: dup
    //   420: aload 19
    //   422: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   425: athrow
    //   426: astore 18
    //   428: new 53	com/itrus/cryptorole/CryptoException
    //   431: dup
    //   432: aload 18
    //   434: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   437: athrow
    //   438: astore 17
    //   440: new 53	com/itrus/cryptorole/CryptoException
    //   443: dup
    //   444: aload 17
    //   446: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   449: athrow
    //   450: astore 29
    //   452: new 53	com/itrus/cryptorole/CryptoException
    //   455: dup
    //   456: aload 29
    //   458: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   461: athrow
    //   462: astore 28
    //   464: new 53	com/itrus/cryptorole/CryptoException
    //   467: dup
    //   468: aload 28
    //   470: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   473: athrow
    //   474: astore 32
    //   476: new 53	com/itrus/cryptorole/CryptoException
    //   479: dup
    //   480: aload 32
    //   482: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   485: athrow
    //
    // Exception table:
    //   from	to	target	type
    //   93	118	296	java/security/InvalidAlgorithmParameterException
    //   93	118	308	java/security/NoSuchAlgorithmException
    //   93	118	320	java/security/NoSuchProviderException
    //   93	118	332	java/security/cert/CertStoreException
    //   93	118	344	org/bouncycastle/cms/CMSException
    //   128	139	356	java/security/NoSuchAlgorithmException
    //   128	139	368	java/security/NoSuchProviderException
    //   128	139	380	org/bouncycastle/cms/CMSException
    //   158	173	414	java/security/NoSuchAlgorithmException
    //   158	173	426	java/security/NoSuchProviderException
    //   158	173	438	org/bouncycastle/cms/CMSException
    //   236	254	450	java/security/cert/CertificateEncodingException
    //   236	254	462	java/io/IOException
    //   286	293	474	java/io/IOException
  }

  public String signMessage(String paramString)
    throws CryptoException
  {
    return new String(Base64.encode(signMessage(paramString.getBytes())));
  }

  public byte[] signMessage(byte[] paramArrayOfByte)
    throws CryptoException
  {
    if ((this.keyOfSigner == null) || (this.certOfSigner == null))
      throw new CryptoException(this.notInitializeKeyMessage);
    X509Certificate[] arrayOfX509Certificate = new X509Certificate[1];
    arrayOfX509Certificate[0] = this.certOfSigner;
    try
    {
      PKCS7SignedData localPKCS7SignedData = new PKCS7SignedData(this.keyOfSigner, arrayOfX509Certificate, this.signAlgorithm.substring(0, this.signAlgorithm.indexOf("With")));
      localPKCS7SignedData.update(paramArrayOfByte, 0, paramArrayOfByte.length);
      byte[] arrayOfByte = localPKCS7SignedData.getEncoded();
      return arrayOfByte;
    }
    catch (InvalidKeyException localInvalidKeyException)
    {
      throw new CryptoException(localInvalidKeyException);
    }
    catch (SecurityException localSecurityException)
    {
      throw new CryptoException(localSecurityException);
    }
    catch (NoSuchProviderException localNoSuchProviderException)
    {
      throw new CryptoException(localNoSuchProviderException);
    }
    catch (NoSuchAlgorithmException localNoSuchAlgorithmException)
    {
      throw new CryptoException(localNoSuchAlgorithmException);
    }
    catch (SignatureException localSignatureException)
    {
      throw new CryptoException(localSignatureException);
    }
  }

  // ERROR //
  public byte[] signMessageIncludeOriginal(byte[] paramArrayOfByte)
    throws NotSupportException, CryptoException
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 166	com/itrus/cryptorole/bc/SenderBcImpl:keyOfSigner	Ljava/security/PrivateKey;
    //   4: ifnull +10 -> 14
    //   7: aload_0
    //   8: getfield 170	com/itrus/cryptorole/bc/SenderBcImpl:certOfSigner	Ljava/security/cert/X509Certificate;
    //   11: ifnonnull +15 -> 26
    //   14: new 53	com/itrus/cryptorole/CryptoException
    //   17: dup
    //   18: aload_0
    //   19: getfield 173	com/itrus/cryptorole/bc/SenderBcImpl:notInitializeKeyMessage	Ljava/lang/String;
    //   22: invokespecial 174	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/String;)V
    //   25: athrow
    //   26: new 498	java/util/ArrayList
    //   29: dup
    //   30: invokespecial 499	java/util/ArrayList:<init>	()V
    //   33: astore_2
    //   34: aload_2
    //   35: aload_0
    //   36: getfield 170	com/itrus/cryptorole/bc/SenderBcImpl:certOfSigner	Ljava/security/cert/X509Certificate;
    //   39: invokeinterface 504 2 0
    //   44: pop
    //   45: ldc_w 389
    //   48: new 391	java/security/cert/CollectionCertStoreParameters
    //   51: dup
    //   52: aload_2
    //   53: invokespecial 400	java/security/cert/CollectionCertStoreParameters:<init>	(Ljava/util/Collection;)V
    //   56: getstatic 33	com/itrus/cryptorole/bc/SenderBcImpl:PROVIDER	Ljava/lang/String;
    //   59: invokestatic 405	java/security/cert/CertStore:getInstance	(Ljava/lang/String;Ljava/security/cert/CertStoreParameters;Ljava/lang/String;)Ljava/security/cert/CertStore;
    //   62: astore 7
    //   64: new 377	org/bouncycastle/cms/CMSSignedDataGenerator
    //   67: dup
    //   68: invokespecial 378	org/bouncycastle/cms/CMSSignedDataGenerator:<init>	()V
    //   71: astore 8
    //   73: aload 8
    //   75: aload_0
    //   76: getfield 166	com/itrus/cryptorole/bc/SenderBcImpl:keyOfSigner	Ljava/security/PrivateKey;
    //   79: aload_0
    //   80: getfield 170	com/itrus/cryptorole/bc/SenderBcImpl:certOfSigner	Ljava/security/cert/X509Certificate;
    //   83: aload_0
    //   84: getfield 507	com/itrus/cryptorole/bc/SenderBcImpl:digestOID	Ljava/lang/String;
    //   87: invokevirtual 387	org/bouncycastle/cms/CMSSignedDataGenerator:addSigner	(Ljava/security/PrivateKey;Ljava/security/cert/X509Certificate;Ljava/lang/String;)V
    //   90: aload 8
    //   92: aload 7
    //   94: invokevirtual 409	org/bouncycastle/cms/CMSSignedDataGenerator:addCertificatesAndCRLs	(Ljava/security/cert/CertStore;)V
    //   97: aload 8
    //   99: new 291	org/bouncycastle/cms/CMSProcessableByteArray
    //   102: dup
    //   103: aload_1
    //   104: invokespecial 292	org/bouncycastle/cms/CMSProcessableByteArray:<init>	([B)V
    //   107: iconst_1
    //   108: getstatic 33	com/itrus/cryptorole/bc/SenderBcImpl:PROVIDER	Ljava/lang/String;
    //   111: invokevirtual 510	org/bouncycastle/cms/CMSSignedDataGenerator:generate	(Lorg/bouncycastle/cms/CMSProcessable;ZLjava/lang/String;)Lorg/bouncycastle/cms/CMSSignedData;
    //   114: invokevirtual 511	org/bouncycastle/cms/CMSSignedData:getEncoded	()[B
    //   117: astore 15
    //   119: aload 15
    //   121: areturn
    //   122: astore 6
    //   124: new 53	com/itrus/cryptorole/CryptoException
    //   127: dup
    //   128: aload 6
    //   130: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   133: athrow
    //   134: astore 5
    //   136: new 53	com/itrus/cryptorole/CryptoException
    //   139: dup
    //   140: aload 5
    //   142: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   145: athrow
    //   146: astore 4
    //   148: new 53	com/itrus/cryptorole/CryptoException
    //   151: dup
    //   152: aload 4
    //   154: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   157: athrow
    //   158: astore 10
    //   160: new 53	com/itrus/cryptorole/CryptoException
    //   163: dup
    //   164: aload 10
    //   166: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   169: athrow
    //   170: astore 9
    //   172: new 53	com/itrus/cryptorole/CryptoException
    //   175: dup
    //   176: aload 9
    //   178: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   181: athrow
    //   182: astore 14
    //   184: new 53	com/itrus/cryptorole/CryptoException
    //   187: dup
    //   188: aload 14
    //   190: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   193: athrow
    //   194: astore 13
    //   196: new 53	com/itrus/cryptorole/CryptoException
    //   199: dup
    //   200: aload 13
    //   202: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   205: athrow
    //   206: astore 12
    //   208: new 53	com/itrus/cryptorole/CryptoException
    //   211: dup
    //   212: aload 12
    //   214: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   217: athrow
    //   218: astore 11
    //   220: new 53	com/itrus/cryptorole/CryptoException
    //   223: dup
    //   224: aload 11
    //   226: invokespecial 152	com/itrus/cryptorole/CryptoException:<init>	(Ljava/lang/Throwable;)V
    //   229: athrow
    //
    // Exception table:
    //   from	to	target	type
    //   45	64	122	java/security/InvalidAlgorithmParameterException
    //   45	64	134	java/security/NoSuchAlgorithmException
    //   45	64	146	java/security/NoSuchProviderException
    //   90	97	158	java/security/cert/CertStoreException
    //   90	97	170	org/bouncycastle/cms/CMSException
    //   97	119	182	java/security/NoSuchAlgorithmException
    //   97	119	194	java/security/NoSuchProviderException
    //   97	119	206	org/bouncycastle/cms/CMSException
    //   97	119	218	java/io/IOException
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.itrus.cryptorole.bc.SenderBcImpl
 * JD-Core Version:    0.6.2
 */